/**
 * 
 */
package com.aspire.android.heliar.raw.mms;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

/**
 * @author panglei
 * 
 */
public class MMSImageFrame extends MMSFrame {

	private Bitmap bitmap;

	public void createBitmap(InputStream in) throws IOException {
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		int i;
		while ((i = in.read()) != -1) {
			bos.write(i);
		}
		byte[] byteArray = bos.toByteArray();
		bitmap = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length);

	}

	public Bitmap getImage() {
		return bitmap;
	}
}
